You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Delete scanner runs which are old (with configurable retention)
For deleted scanner runs delete all associated Coponent Instance Trackers and Errors
Change autopatch database objects' ids from int to int64
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
What type of PR is this? (check all applicable)
🍕 Feature
🐛 Bug Fix
📝 Documentation Update
🎨 Style
🧑💻 Code Refactor
🔥 Performance Improvements
✅ Test
🤖 Build
🔁 CI
📦 Chore (Release)
⏩ Revert
Related Tickets & Documents
Related Issue # (issue)
Closes # (issue)
Fixes # (issue)
Remove if not applicable
Added tests?
👍 yes
🙅 no, because they aren't needed
🙋 no, because I need help
Separate ticket for tests # (issue/pr)
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Added to documentation?
📜 README.md
🤝 Documentation pages updated
🙅 no documentation needed
(if applicable) generated OpenAPI docs for CRD changes
Checklist
My code follows the style guidelines of this project
I have performed a self-review of my code
I have commented my code, particularly in hard-to-understand areas
I have made corresponding changes to the documentation
My changes generate no new warnings
I have added tests that prove my fix is effective or that my feature works
New and existing unit tests pass locally with my changes
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Concurrent cleanup can delete trackers still needed by autopatch, leaving vulnerabilities unpatched, while soft-deleted runs remain visible and counted by production queries.
Adds configurable scanner-run retention to the scanner completion workflow, removing older completed runs’ trackers and errors while soft-deleting the runs.
Changes:
Adds per-tag retention configuration, disabled by default, and invokes cleanup after autopatch.
Extends database interfaces and wrappers for cleanup and standardizes autopatch identifiers on int64.
Adds cleanup tests and fixtures, updates handler construction, and changes gRPC checksums.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Retention cleanup leaves soft-deleted runs visible in public reads, can delete runs still uploading, and lacks transactional protection against partial deletion of scan history.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Cleanup can delete newly created runs and their associated data because it uses a stale keep-list, while the new tests also leave seeder database connections open.
NewDatabaseSeeder opens a separate database connection pool, but this helper drops the seeder reference without closing it. The teardown only closes at.db and the database manager's client, so each new test leaves its seeder pool open. Please defer dbSeeder.CloseDbConnection() after the successful setup check; the seeder is no longer needed once this helper returns.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Autopatch now loads all non-deleted failed and in-progress runs on every successful completion, creating growing transfer and allocation overhead because default retention never prunes that history.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The global guard can cause scanner lifecycle requests to time out across tags, while retention-count overflow can trigger unintended deletion of run history.
- change logic to delete not listed items
- add synchronization for Autoclean, Autopatch and
scannerrun table create/update
On-behalf-of: SAP Michal Krzyz <michal.krzyz@sap.com>
Signed-off-by: Michal Krzyz <michalkrzyz@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
What type of PR is this? (check all applicable)
Related Tickets & Documents
Added tests?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Added to documentation?
Checklist